package org.tuio4j.profile.cursor2d;

import org.tuio4j.TuioEvent;

/**
 * See license.txt for license information.
 * @author Uwe Laufs
 * @version 1.0
 */
public class Tuio2DCursorEvent extends TuioEvent {
	private int sessionId;
	private float xRel;
	private float yRel;
	private float xVelocity;
	private float yVelocity;
	private float motionAcceleration;
	
	public Tuio2DCursorEvent(int eventTypeId, int sessionId, float xRel, float yRel, float xVelocity, float yVelocity, float motionAcceleration){
		super(eventTypeId);
		this.sessionId = sessionId;
		this.xRel = xRel;
		this.yRel = yRel;
		this.xVelocity = xVelocity;
		this.yVelocity = yVelocity;
		this.motionAcceleration = motionAcceleration;
	}
	public int getSessionId() {
		return sessionId;
	}
	public float getXRel() {
		return xRel;
	}
	public float getYRel() {
		return yRel;
	}
	public float getXVelocity() {
		return xVelocity;
	}
	public float getYVelocity() {
		return yVelocity;
	}
	public float getMotionAcceleration() {
		return motionAcceleration;
	}
	public String toString(){
		String typeString="NO TYPE";
		if(this.getEventTypeId()==TuioEvent.SESSION_DETECTED){
			typeString = "SESSION_DETECTED";
		}else if(this.getEventTypeId()==TuioEvent.SESSION_UPDATED){
			typeString = "SESSION_UPDATED";
		}else if(this.getEventTypeId()==TuioEvent.SESSION_ENDED){
			typeString = "SESSION_ENDED";
		}
		return typeString +
				" sid:" + this.getSessionId() +
				" x:" + this.getXRel() +
				" y:" + this.getYRel() +
				" xVel:" + this.getXVelocity() +
				" yVel:" + this.getYVelocity() +
				" mAcl:" + this.getMotionAcceleration();
	}
}
